﻿using CommonLib;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;

public class GameStateStartUp : GameStateBase
{

	public override string StateKey => "StartUp";

	bool m_IsComplete = false;

	public override void EnterState()
	{
		m_IsComplete = false;
		Debug.Log($"当前状态为{ StateKey }");
		//EndState(GameStateController.GetGameState(GameState.Login));
		//Do Start Up PrePare	
	}

	float duration;
	public override void StateUpdate()
	{
		duration += Time.deltaTime;
		if( duration >= 5)
		{
			m_IsComplete = true;
		}
	}

	public IEnumerator EndStartUpState ()
	{
		while(!m_IsComplete)
			yield return null;
		EndState(GameStateController.GetGameState(GameState.GamePlay));
	}
}
